package com.ahu.mapper;

import com.ahu.pojo.User;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

/**
 * Author: Zhang Dongwei
 * Date: 2022/5/14 12:19
 */
public class UserMapperImpl implements UserMapper {

    // 我们的所有操作，都使用sqlsession来执行，在原来，现在都是使用sqlSessionTemplate;
    private SqlSessionTemplate sqlSession;

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

    public List<User> selectUser() {
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        return mapper.selectUser();
    }
}
